package com.example.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.example.pojo.User;
import com.example.service.UserService;

@RestController
@RequestMapping("/use")
public class UserController {
@Autowired
private UserService service;

//查询所有
@RequestMapping("/findall")
public List<User> findall(){
	return service.findall();
}
//验证账号密码
@RequestMapping(value = "/login")
public String login(String acid,String password) {
    User user = service.login(acid, password);
    if (user != null) {
        return "1";
    } else {
        return "0";
    }
}

}
